package com.aly.beanValidate.core.validator;

import com.aly.beanValidate.core.FieldDefinition;
import com.aly.beanValidate.i.BeanInfo;
import com.aly.beanValidate.i.FileInfo;
import com.aly.beanValidate.i.FileInfos;

public interface Validatable {
    StringBuffer doValidate(FieldDefinition field, Object val, BeanInfo bean, FileInfo fileInfo, FileInfos fileInfos);

   default void validate(StringBuffer ret,FieldDefinition field, Object val, BeanInfo bean, FileInfo fileInfo, FileInfos fileInfos){
       StringBuffer validate = doValidate(field, val, bean, fileInfo, fileInfos);
       if (null != validate && validate.length() > 0) {
           ret.append(ret);
       }
   }
}
